package com.ruoyi.common.constant;

/**
 * 网关配置相关常量
 */
public final class GatewayConfigConstants {

    // 通用配置键
    public static final class Key {
        public static final String SERIAL_PORT = "serial_port";
        public static final String BAUDRATE = "baudrate";
        public static final String PARITY_CHECK = "parity_check";
        public static final String DEV_PORT = "dev_port";
        public static final String LISTEN_PORT = "listen_port";
        public static final String TRANS_FLAG = "trans_flag";
        public static final String DATA = "data";
        public static final String UP_PORTS = "up_ports";
        public static final String DOWN_PORTS = "down_ports";

        // 数据项键
        public static final class Data {
            public static final String SLAVE_ADDR = "slave_addr";
            public static final String FUNC_CODE = "func_code";
            public static final String REG_NUM = "reg_num";
            public static final String START_ADDR = "start_addr";
        }
    }

    // 错误相关
    public static final class Error {
        public static final String EMPTY_DEV_SN = "设备SN不能为空";
        public static final String DEVICE_NOT_CONFIGURED = "设备未配置";

    }

    // 日志相关
    public static final class Log {
        public static final String PREFIX = "【网关下发配置】";
        public static final String WARN_PROTOCOL_MISSING = "{}协议配置不存在 - protocolId: {}";
        public static final String WARN_NUM_CONVERSION = "{}数值转换失败 - key: {}, value: {}";
    }

    // 阻止实例化
    private GatewayConfigConstants() {
        throw new AssertionError("禁止实例化常量类");
    }
}
